<?php
namespace Home\Controller;
use Think\Controller;
class BaseController extends Controller {
	private $mJingjing;
	protected $base_url;
	protected $admin_url;

	public function __construct()	
	{
		parent::__construct();
		$this->base_url = C('BASE_URL');
		$this->admin_url = C('ADMIN_URL');
		$this->assign('base_url', $this->base_url);
		$this->assign('admin_url', $this->admin_url);
	}

	protected function toStr($field) {
		if(isset($_REQUEST[$field])) {
			$val = $_REQUEST[$field];
			if(is_array($val)) {
				return $val;
			} else {
				$val = strval($val);
				$val = trim($val);
				return $val;
			}
		}
		return '';
	}

	protected function toInt($field) {
		return isset($_REQUEST[$field]) ? intval($_REQUEST[$field]) : 0;
	}

}